package org.mozhu.zufang.system.group.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mozhu.mboot.core.data.entity.Activatable;
import org.mozhu.mboot.core.data.entity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 分组超类
 */
@Entity
@Table(name = "sys_group")
@Data
@EqualsAndHashCode(callSuper = true)
public class Group extends BaseEntity implements Activatable {

	/**
	 * 分组名称
	 */
	private String name;

	/**
	 * 分组类型 如 用户分组/组织机构分组
	 */
	private String type;

	/**
	 * 是否是默认分组
	 */
	@Column(name = "default_group")
	private Boolean defaultGroup = Boolean.FALSE;

	/**
	 * 激活(TRUE)，冻结(FALSE)
	 */
	private Boolean activated = Boolean.TRUE;

	@Override
	public Boolean getActivated() {
		return activated;
	}

	@Override
	public void setActivated(Boolean activated) {
		this.activated = activated;
	}

	@Override
	public void markActivated() {
		this.activated = Boolean.TRUE;
	}

	@Override
	public void markDeactivated() {
		this.activated = Boolean.FALSE;
	}
}
